package com.zhilianbao.leyaogo.model.response.shoppingcart;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Author: hcy
 * Description:购物车商品
 * Created: 2016/11/17 15:12
 */
public class ShoppingCartGood implements Parcelable {
    private long goodsId;//主键
    private long supplierId;//供应商ID,
    private long shopId;//所属店铺ID,
    private long classifyId;//所属商品分类 0 与分类无关 对应叶子节点 ,
    private long customClassifyId;//所属店铺自定义分类 0 与分类无关 对应叶子节点 ,
    private long brandId;//商品所属品牌 0 品牌无关,
    private int goodsClassify;//商品类型 0 实物商品 1 虚拟商品 2 电子卡券,
    private int goodsType;//商品类型 0 SPU商品 1 SKU商品 2 组合商品,
    private String goodsSn;//商品编码 店铺唯一,
    private String goodsName;//商品名称,
    private String goodsFullName;//商品全名,
    private String goodsPic;//商品图片,
    private String goodsDesc;//商品简介,
    private String unit;//库存类型 0 无限制 1 SPU独立库存 2 SKU共享库存 3 SKU独立库存,
    private int stockType;//销售单位,
    private int stockNumber;//库存数量 1 SPU独立库存 2 SKU共享库存 设置,
    private int stockWarn;//库存提醒设置数量,
    private double getmPrice;//市场价,
    private double price;//销售价,
    private double fixedPrice;//销售固定价,
    private int limitNumber;//限购数量 0 表示无限制,
    private int sortIndex;//排序 ,
    private int isHot;//是否推荐商品 0 否 1 是 ,
    private int enshrineNumber;//商品关注数量 ,
    private int saleNumber;//商品销售数量 ,
    private int voucherNumber;//商品评论数量 , ,
    private int saleTimeType;//开售时间 0 立即开售 1 定时开售 ,
    private String saleDtm;//开售时间 ,
    private String comments;//备注 ,
    private String goodsSign;// (string, optional): 商品标签
    private int statusCode;// (integer, optional): 状态 0 下架 1 上架 ,
    private int stockStatus;// (integer, optional): 库存状态 0库存充足 1库存不足 2库存紧张 ,
    private int deleteFlag;// (integer, optional): 软删除状态 0 正常 1 删除 ,
    private int number;//购买数量,
    private List<GoodsSKU> sku;

    /**********************
     * 额外添加
     **********************/
    private boolean isChecked;//是否选中
    private int state;//0可购买，1下架，2库存不足,3已删除
    private boolean isActivity;//是否是活动商品

    private int type;//0商品数据，1活动标题，2活动与其他商品数据的间隔，3无效商品与其他商品的间隔
    private long activityId;//满足活动id
    private int activityType;//活动类型
    private boolean isMatch;//Title是否满足活动
    private String title;//活动名称
    private String titleDes;//活动详情
    private int limitCount;//活动1,2（特价，新人专享,满减）,限购数量，
    private double discountPrice;//活动1,2（特价，新人专享）用到价格
    private int priceType;//活动1,2（特价，新人专享）用到--0价格特价，1折扣特价
    private double cutPrice;//满减的减金额
    private double cutFullPrice;//满减的金额

    private double amountPrice;// (number, optional): 实际金额 ,
    private double orderAllotPrice;// (number, optional): 订单分配金额 根据明细金额与订单总优惠金额按照权重计算分配金额 ,

    public ShoppingCartGood() {
    }

    protected ShoppingCartGood(Parcel in) {
        goodsId = in.readLong();
        supplierId = in.readLong();
        shopId = in.readLong();
        classifyId = in.readLong();
        customClassifyId = in.readLong();
        brandId = in.readLong();
        goodsClassify = in.readInt();
        goodsType = in.readInt();
        goodsSn = in.readString();
        goodsName = in.readString();
        goodsFullName = in.readString();
        goodsPic = in.readString();
        goodsDesc = in.readString();
        unit = in.readString();
        stockType = in.readInt();
        stockNumber = in.readInt();
        stockWarn = in.readInt();
        getmPrice = in.readDouble();
        price = in.readDouble();
        fixedPrice = in.readDouble();
        limitNumber = in.readInt();
        sortIndex = in.readInt();
        isHot = in.readInt();
        enshrineNumber = in.readInt();
        saleNumber = in.readInt();
        voucherNumber = in.readInt();
        saleTimeType = in.readInt();
        saleDtm = in.readString();
        comments = in.readString();
        goodsSign = in.readString();
        statusCode = in.readInt();
        stockStatus = in.readInt();
        deleteFlag = in.readInt();
        number = in.readInt();
        sku = in.createTypedArrayList(GoodsSKU.CREATOR);
        isChecked = in.readByte() != 0;
        state = in.readInt();
        isActivity = in.readByte() != 0;
        type = in.readInt();
        activityId = in.readLong();
        activityType = in.readInt();
        isMatch = in.readByte() != 0;
        title = in.readString();
        titleDes = in.readString();
        limitCount = in.readInt();
        discountPrice = in.readDouble();
        priceType = in.readInt();
        cutPrice = in.readDouble();
        amountPrice = in.readDouble();
        orderAllotPrice = in.readDouble();
        cutFullPrice = in.readDouble();

    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(goodsId);
        dest.writeLong(supplierId);
        dest.writeLong(shopId);
        dest.writeLong(classifyId);
        dest.writeLong(customClassifyId);
        dest.writeLong(brandId);
        dest.writeInt(goodsClassify);
        dest.writeInt(goodsType);
        dest.writeString(goodsSn);
        dest.writeString(goodsName);
        dest.writeString(goodsFullName);
        dest.writeString(goodsPic);
        dest.writeString(goodsDesc);
        dest.writeString(unit);
        dest.writeInt(stockType);
        dest.writeInt(stockNumber);
        dest.writeInt(stockWarn);
        dest.writeDouble(getmPrice);
        dest.writeDouble(price);
        dest.writeDouble(fixedPrice);
        dest.writeInt(limitNumber);
        dest.writeInt(sortIndex);
        dest.writeInt(isHot);
        dest.writeInt(enshrineNumber);
        dest.writeInt(saleNumber);
        dest.writeInt(voucherNumber);
        dest.writeInt(saleTimeType);
        dest.writeString(saleDtm);
        dest.writeString(comments);
        dest.writeString(goodsSign);
        dest.writeInt(statusCode);
        dest.writeInt(stockStatus);
        dest.writeInt(deleteFlag);
        dest.writeInt(number);
        dest.writeTypedList(sku);
        dest.writeByte((byte) (isChecked ? 1 : 0));
        dest.writeInt(state);
        dest.writeByte((byte) (isActivity ? 1 : 0));
        dest.writeInt(type);
        dest.writeLong(activityId);
        dest.writeInt(activityType);
        dest.writeByte((byte) (isMatch ? 1 : 0));
        dest.writeString(title);
        dest.writeString(titleDes);
        dest.writeInt(limitCount);
        dest.writeDouble(discountPrice);
        dest.writeInt(priceType);
        dest.writeDouble(cutPrice);
        dest.writeDouble(amountPrice);
        dest.writeDouble(orderAllotPrice);
        dest.writeDouble(cutFullPrice);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ShoppingCartGood> CREATOR = new Creator<ShoppingCartGood>() {
        @Override
        public ShoppingCartGood createFromParcel(Parcel in) {
            return new ShoppingCartGood(in);
        }

        @Override
        public ShoppingCartGood[] newArray(int size) {
            return new ShoppingCartGood[size];
        }
    };

    public double getCutFullPrice() {
        return cutFullPrice;
    }

    public void setCutFullPrice(double cutFullPrice) {
        this.cutFullPrice = cutFullPrice;
    }

    public long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(long goodsId) {
        this.goodsId = goodsId;
    }

    public long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(long supplierId) {
        this.supplierId = supplierId;
    }

    public long getShopId() {
        return shopId;
    }

    public void setShopId(long shopId) {
        this.shopId = shopId;
    }

    public long getClassifyId() {
        return classifyId;
    }

    public void setClassifyId(long classifyId) {
        this.classifyId = classifyId;
    }

    public long getCustomClassifyId() {
        return customClassifyId;
    }

    public void setCustomClassifyId(long customClassifyId) {
        this.customClassifyId = customClassifyId;
    }

    public long getBrandId() {
        return brandId;
    }

    public void setBrandId(long brandId) {
        this.brandId = brandId;
    }

    public int getGoodsClassify() {
        return goodsClassify;
    }

    public void setGoodsClassify(int goodsClassify) {
        this.goodsClassify = goodsClassify;
    }

    public int getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(int goodsType) {
        this.goodsType = goodsType;
    }

    public String getGoodsSn() {
        return goodsSn;
    }

    public void setGoodsSn(String goodsSn) {
        this.goodsSn = goodsSn;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsFullName() {
        return goodsFullName;
    }

    public void setGoodsFullName(String goodsFullName) {
        this.goodsFullName = goodsFullName;
    }

    public String getGoodsPic() {
        return goodsPic;
    }

    public void setGoodsPic(String goodsPic) {
        this.goodsPic = goodsPic;
    }

    public String getGoodsDesc() {
        return goodsDesc;
    }

    public void setGoodsDesc(String goodsDesc) {
        this.goodsDesc = goodsDesc;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public int getStockType() {
        return stockType;
    }

    public void setStockType(int stockType) {
        this.stockType = stockType;
    }

    public int getStockNumber() {
        return stockNumber;
    }

    public void setStockNumber(int stockNumber) {
        this.stockNumber = stockNumber;
    }

    public int getStockWarn() {
        return stockWarn;
    }

    public void setStockWarn(int stockWarn) {
        this.stockWarn = stockWarn;
    }

    public double getGetmPrice() {
        return getmPrice;
    }

    public void setGetmPrice(double getmPrice) {
        this.getmPrice = getmPrice;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getFixedPrice() {
        return fixedPrice;
    }

    public void setFixedPrice(double fixedPrice) {
        this.fixedPrice = fixedPrice;
    }

    public int getLimitNumber() {
        return limitNumber;
    }

    public void setLimitNumber(int limitNumber) {
        this.limitNumber = limitNumber;
    }

    public int getSortIndex() {
        return sortIndex;
    }

    public void setSortIndex(int sortIndex) {
        this.sortIndex = sortIndex;
    }

    public int getIsHot() {
        return isHot;
    }

    public void setIsHot(int isHot) {
        this.isHot = isHot;
    }

    public int getEnshrineNumber() {
        return enshrineNumber;
    }

    public void setEnshrineNumber(int enshrineNumber) {
        this.enshrineNumber = enshrineNumber;
    }

    public int getSaleNumber() {
        return saleNumber;
    }

    public void setSaleNumber(int saleNumber) {
        this.saleNumber = saleNumber;
    }

    public int getVoucherNumber() {
        return voucherNumber;
    }

    public void setVoucherNumber(int voucherNumber) {
        this.voucherNumber = voucherNumber;
    }

    public int getSaleTimeType() {
        return saleTimeType;
    }

    public void setSaleTimeType(int saleTimeType) {
        this.saleTimeType = saleTimeType;
    }

    public String getSaleDtm() {
        return saleDtm;
    }

    public void setSaleDtm(String saleDtm) {
        this.saleDtm = saleDtm;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getGoodsSign() {
        return goodsSign;
    }

    public void setGoodsSign(String goodsSign) {
        this.goodsSign = goodsSign;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public int getStockStatus() {
        return stockStatus;
    }

    public void setStockStatus(int stockStatus) {
        this.stockStatus = stockStatus;
    }

    public int getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(int deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public List<GoodsSKU> getSku() {
        return sku;
    }

    public void setSku(List<GoodsSKU> sku) {
        this.sku = sku;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public boolean isActivity() {
        return isActivity;
    }

    public void setActivity(boolean activity) {
        isActivity = activity;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public long getActivityId() {
        return activityId;
    }

    public void setActivityId(long activityId) {
        this.activityId = activityId;
    }

    public int getActivityType() {
        return activityType;
    }

    public void setActivityType(int activityType) {
        this.activityType = activityType;
    }

    public boolean isMatch() {
        return isMatch;
    }

    public void setMatch(boolean match) {
        isMatch = match;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitleDes() {
        return titleDes;
    }

    public void setTitleDes(String titleDes) {
        this.titleDes = titleDes;
    }

    public int getLimitCount() {
        return limitCount;
    }

    public void setLimitCount(int limitCount) {
        this.limitCount = limitCount;
    }

    public double getDiscountPrice() {
        return discountPrice;
    }

    public void setDiscountPrice(double discountPrice) {
        this.discountPrice = discountPrice;
    }

    public int getPriceType() {
        return priceType;
    }

    public void setPriceType(int priceType) {
        this.priceType = priceType;
    }

    public double getCutPrice() {
        return cutPrice;
    }

    public void setCutPrice(double cutPrice) {
        this.cutPrice = cutPrice;
    }

    public double getAmountPrice() {
        return amountPrice;
    }

    public void setAmountPrice(double amountPrice) {
        this.amountPrice = amountPrice;
    }

    public double getOrderAllotPrice() {
        return orderAllotPrice;
    }

    public void setOrderAllotPrice(double orderAllotPrice) {
        this.orderAllotPrice = orderAllotPrice;
    }
}
